import { get, post, put, del } from '@/utils/request'

export const listAllMenus = async () => {
    try {
        const response = await get<any>('/menu/listAll');
        return response;
    } catch (error) {
    }
};

export const addMenu = async (data: any) => {
    try {
        const response = await post<any>('/menu/add', data);
        return response;
    } catch (error) {
    }
};

export const deleteMenu = async (data: any) => {
    try {
        const response = await post<any>('/menu/delete', data);
        return response;
    } catch (error) {
    }
};


export interface Tree {
    id: number,
    name: string,
    enName: string,
    children?: Tree[]
}
export interface DefaultProps {
    children: string,
    label: string,
}
export interface MenuAddRequest {
    name: string,
    enName: string,
    parentId: number,
}
export interface RoleMenuRequest {
    roleId: number,
    menuIdList: number[],
}